drop view dbo.view_login
go

create view dbo.view_login
as
	select email,
	       'P' login_type,
	       [password],
	       first_name,
	       last_name,
	       id,
	       first_name + ' ' + last_name full_name
	  from parents
	     where active_flag = 1
	union
	select email,
	       'E' login_type,
	       [password],
	       first_name,
	       last_name,
	       id,
	       first_name + ' ' + last_name full_name
	  from employees
	     where active_flag = 1